package com.youhp.spire.xls.demo.Worksheets;

import com.spire.xls.*;

public class RemoveWorksheet {
    public static void main(String[] args) {
        String inputFile = "data/RemoveWorksheet.xlsx";
        String outputFile = "output/RemoveWorksheet_out.xlsx";

        //Create a workbook and load a file
        Workbook workbook = new Workbook();
        workbook.loadFromFile(inputFile);

        //Remove a worksheet by sheet index
        workbook.getWorksheets().removeAt(1);

        //Save the Excel file
        workbook.saveToFile(outputFile, ExcelVersion.Version2013);
    }
}
